Anisotropic harmonic oscillator in a static electromagnetic field