Work on current loop placed in a magnetic field: how can there be work done against magnetic forces? I'm facing some doubts while studying the lecture on magnetic dipole potential energy http://www.feynmanlectures.caltech.edu/II_15.html - "15–1 The forces
on a current loop; energy of a dipole".
When it's showed that, for a rectangular loop, $\mathrm{U_{mech}}$ corresponds to the mechanical work done in bringing the loop into a magnetic  field $\bf{B}$ (from equation $(15.6)$ to equation $(15.11)$) the work on the loop "against magnetic forces" is calculated. 
My question is: since magnetic forces never do work on electrons in the loop, how can there be a work done against them?

The explanation I tried to give myself is the following. As explained in the following sections of the lecture, the velocity of the electrons is not parallel to the loop but is also has a component due to the traslational motion. Therefore the force considered when the work is calculated shouldn't be the total magnetic force, but only a part of it. So maybe this has something to do with the possibility for this force to do work? 
I'm getting a bit confused on the topic, any suggestion is highly appreciated.
 A: Feynman is right in a sense, but you are also right that magnetic forces do not work (in other sense).
What Feynman means is that when we consider force that acts on the conductor (wire) due to it carrying electric current while in external magnetic field, this force does work on the conductor. This force is macroscopic result of zillions of EM forces that consist of external magnetic forces and internal electric and magnetic forces acting on the wire. 
This net macroscopic force can be expressed as function of external magnetic field ($ILB$) so it is called magnetic force. In the example from the text, external force indeed counteracts the magnetic force, and so it is doing work.
What you mean is that elementary magnetic force acting on a charged particle does no work.
You are both right! Feynman is talking about macroscopic force on a wire, while you are talking about microscopic Lorentz force on a charged particle.
Net work of magnetic forces is zero, but the work Feynman calculates is not zero. That's because he is not calculating net work of all magnetic forces! He is calculating macroscopic work of a net macroscopic force. This force is also called magnetic, but in reality it is a sum of many many electric and magnetic forces.
