Lateral confinement in quantum nanostructures: Self-consistent screening potentials