TL;DR: What if people didn't have a need to invent / what if they accepted a faulty theory based on magic for science / what if use of magic strains the mind?
Allow me to make some generalizations, so that I may reduce innovative "power" by showing how these groups of people don't have a reason or don't have the means to advance research.
People are lazy and will use any means that doesn't take too much effort at their disposal to do a task in a simpler manner.
Academics are interested in the workings of something, and will dedicate time towards discovering how it works and how to apply this knowledge.
We need to find a way to stop both of these archetypes from progressing technology.
The people
If magic can be shaped to one's will, then some of the hard work might be made easier through the use of magic. This leads to a less pressing need to come up with an easier method. Unless magic is expensive, it comes with the convenience of being always available. Physical, technological objects tend to lack this property. An example of this convenience would be a remote control in our world: when one doesn't have to get up to perform an action, there's no pressing need to invent.
Before I go on, there's something else that needs to be addressed: Why do we reach medieval technology at all? Well, personally, I believe that even with magic, the feudal system will still occur. It is this feudal system that brings the technologies. A landlord may dictate how the land must be farmed; after all, if lands cultivated in manner X are more productive than lands cultivated in manner Y, then perhaps all lands should be cultivated in manner X.
Why one would smelt iron and develop tools, I don't know. Perhaps because controlling fire doesn't help with farming land. So some still need tools.
Academics
What could make curious people stop looking? Stigmas, perhaps. But looking at our scientific history...
In 1667, there was the idea that there were spirits in substances. They called them Phlogiston. The wikipedia article contains the following excerpt:
In general, substances that burned in air were said to be rich in phlogiston; the fact that combustion soon ceased in an enclosed space was taken as clear-cut evidence that air had the capacity to absorb only a finite amount of phlogiston. When air had become completely phlogisticated it would no longer serve to support combustion of any material, nor would a metal heated in it yield a calx; nor could phlogisticated air support life. Breathing was thought to take phlogiston out of the body.
Now, imagine if there was a faulty (by our standards!) theory that had these "magical spirits" that "conduct magic". There are 4 elements to control, and various substances are made of these four elements. Depending on how much of an element it contains, one can control it to a certain degree.
Faulty theories ("The sun rotates around the earth") can halt scientific/academic progress for a long time. Add in a world where strange occurrences CAN be explained by magic, and it becomes that much harder to advance technology.
Another way to halt scientific progress is if the use of magic strains the mind. If people are constantly mentally tired from doing magic (because by doing magic, a by-product that affects the brain forms in the body), they might not make discoveries as fast.
This is all a "maybe if" statement, though. Humans are such curious beings. Personally, I think that what you propose can't happen - there'll always be some people who will try to find out the workings of the universe, and magic will just be integrated with that. It might go at a slower progress, however. A slower rate of technological progress is also not too strange. They won't stay stuck at the middle ages, but I could see the middle ages stretching a couple thousand years.