A splitting approach for the magnetic Schrödinger equation