A superconducting layer exposed to a perpendicular electric field and a parallel magnetic field is considered within the Ginzburg-Landau (GL) approach. The GL equation is solved near the surface and the surface energy is calculated. The nucleation critical field of superconducting state at the surface depends on the magnetic and electric fields. Special consideration is paid to the induced magnetic-field effect caused by diamagnetic surface currents. The latter effect is strongly dependent on the thickness of the sample. The effective inverse capacitance determines the effective penetration depth. It is found that the capacitance exhibits a jump at the surface critical field. An experiment is suggested for determining the change in the effective capacitance of the layer.