In this study, frictionless continuous and discontinuous contact problems between an electrically conducting rigid flat punch and a homogeneous layer are considered. The body force of the layer is considered, and the layer is lying on the rigid substrate without bond. Thus, if the external load is smaller than a certain critical value, the contact between the layer and substrate is continuous. However, when the external loads exceed the critical value, there is a separation between the layer and substrate on the finite region, that is, discontinuous contact. Using the Fourier integral transform technique, the general expressions of the stresses and displacements are derived in the presence of body force. Using the boundary conditions, the singular integral equations are obtained for both the continuous and discontinuous contact cases. The Gauss-Chebyshev integration formulas are utilized to convert the singular integral equations into a set of nonlinear equations which are solved using a suitable iterative algorithm to yield the lengths of the separation region and the associated contact pressure and normal electric displacement. The singular integral equations are solved numerically applying the appropriate Gauss-Chebyshev integration formulas. This is the first study that investigates the contact problem of the piezoelectric materials in the presence of the body force.