How is energy conserved in this case? Consider a permanent magnet introducing a magnetic field at some fixed angle to a loop of wire on a spindle. If a fixed current is allowed to run through the wire, the lorentz force introduces a net torque on the system and causes it to rotate. This will increase the KE of the loop, where does this energy come from? Note that the loop has contacts such that when it turns through 180 degrees, it will have its current flowing in the opposite direction. 
My initial guess was that it came from the electrons doing work against the magnetic field, but the lorentz force is perpendicular to the current, and so the electrons don't do any work against it. 
I've just started the course on magnetostatics and our lecturer hasn't discussed magnetic potential energy, but I think that this is what I am missing from my analysis. Is it the case that by introducing the magnetic field, we have given the system some amount of magnetic potential energy that it then converts to KE?
 A: What you are missing here is back EMF. As the loop of current turns in the magnetic field, an opposing voltage is induced across it due to Lenz's Law. This lowers the overall potential difference that the loop is subject to, and, since the resistance of the loop does not change, the current also decreases relative to the loop being stationary in the field due to Ohm's Law. (In fact, this is often used in practical applications to measure motor speed, as the current passing through the motor decreases as rotational speed increases.) You can therefore say that the kinetic energy of the loop is extracted from the electric potential energy driving the current in the loop. In other words, some of the original potential difference across the loop is converted into kinetic energy by magnetic induction within the loop, and the amount of conversion that happens exactly corresponds to the back EMF.
A: In addition to the answer provided by @probably_someone, remember that there is energy associated with constructing the initial state of your thought experiment. One must bring the magnet and loop together from far away, and in doing so must hold the loop in its non-equilibrium position until the experiment begins. The energy cost of doing this is stored in the fields.
