Invariant analytical solutions for the motion of an elastic string with electric current in a static magnetic field