We investigate, in a self-consistent manner, the effects of the Coulombic interaction on the electron and hole wave functions of an exciton in a quantum-well structure. The method developed includes a dimensionality parameter which allows the relative motion term in the exciton wave function to assume two-dimensional, three-dimensional, or any intermediate symmetry should it be energetically favorable to do so. The results are compared with those obtained using either a two- or three-dimensional form for the relative motion. A study of the magnetic-field-induced type-I-type-II transition in diluted magnetic semiconductors shows that the inclusion of self-consistency is essential to an understanding of the optical properties of quantum-well structures with flat or type-II valence-band alignments. A comparison with observations of this phenomenon is given.