We present a variational calculation of the energy levels of an exciton confined to a CdTe quantum well by semimagnetic (Cd,Mn)Te potential barriers. The degeneracy of the top of the valence band is lifted by strain and quantum confinement effects, introducing a preferential axis of quantization for the heavy mj=(3/2) doublet. This results in strongly anisotropic magnetic field shifts of the levels. The shifts are greatly enhanced due to the penetration of the wave functions into the barriers, where they are subject to the exchange potential of the polarized Mn spins. Our results are in good qualitative agreement with recent photoluminescence data on CdTe-(Cd,Mn)Te superlattices. © 1986 The American Physical Society.