Quantum confinement effect on the impurity states of a spherical confining system