Surface quantization effect on the macroscopic characteristics of semiconductor space-charge layers