The depletion layer in the p-n junction region is caused by