A Semilinear Schrödinger Equation in the Presence of a Magnetic Field