A dynamic frictionless contact problem between a viscoelastic body and a rigid obstacle is numerically studied in this paper. The contact is modelled using an adapted unilateral contact law in terms of velocities in order to obtain some energy conservation properties. The variational formulation is briefly recalled. Then, a fully discrete scheme is introduced based on the finite element method to approximate the spatial variable and the midpoint scheme to discretize the time derivatives. Error estimates are derived on the approximative solutions from which the linear convergence of the algorithm is deduced under suitable regularity conditions. Furthermore, we focus our interest on the analysis of the discrete energy evolution and the presentation of an adapted numerical algorithm. Finally, a representative two-dimensional example is presented to demonstrate the accuracy and the energy consistent properties of the numerical scheme.