We investigate the energy states of confined electrons in doped quantum structures with Razavy-like confining potentials. The theoretical investigation is performed within the effective mass and parabolic band approximations, including the influence of externally applied electric and magnetic fields. First, we analyze the case of a Razavy quantum well and determine its conduction subband spectrum, focusing on the lowest energy levels and their probability densities. These properties have been numerically determined by self-consistently solving the coupled system of Schr"{o}dinger, Poisson, and charge neutrality equations. Doping is introduced via an on-center $\delta$-like layer. In order to evaluate the associated total (linear plus nonlinear) optical absorption coefficient (TOAC), we have calculated the corresponding diagonal and off-diagonal electric dipole matrix elements, the main energy separation, and the occupancy ratio which are the main factors governing the variation of this optical response. A detailed discussion is given about the influence of doping concentration as well as electric and magnetic fields, which can produce shifts in the light absorption signal, towards either lower or higher frequencies. As an extension of the self-consistent method to a two-dimensional problem, the energy states of quantum wire system of circular cross section, with internal doping and Razavy potential have been calculated. The response of eigenvalues, self-consistent potentials and electron densities is studied with the variation of $\delta$-doping layer width and of the donor density. Finally, the origin of Friedel-like oscillations, that arise in the density profile, generated by the occupation of internal and surface electronic states has been explained.