On the interaction between differential rotation and magnetic fields in the Sun