First, although static magnetic fields can't do work, time varying magnetic fields can. Second, whenever work is done under the influence of a static magnetic field, some external source will have to supply the energy require (as opposed to an electric field that can do work on its own).
Let's...