Analytical treatment of synchronization of spin-torque oscillators by microwave magnetic fields