A quasistatic frictionless contact problem is studied, modelled with the Signorini contact condition with a gap function. The material behavior is modelled with an electro-elastic–visco-plastic constitutive law, allowing piezoelectric effects. A weak formulation for the model is given in the form of a coupled system for the displacement, the stress, the electric displacement and the electric potential fields. Existence and uniqueness of a weak solution is proved. A fully discrete scheme is introduced for solving the problem. Under certain solution regularity assumptions, an optimal order error estimate is derived. Some numerical results are reported on a two-dimensional test problem.