In this paper, we use the virtual element method to solve a history-dependent hemivariational inequality arising in contact problems. The contact problem concerns the deformation of a viscoelastic body with long memory, subjected to a contact condition with non-monotone normal compliance and unilateral constraints. A fully discrete scheme based on the trapezoidal rule for the discretization of the time integration and the virtual element method for the spatial discretization are analyzed. We provide a unified priori error analysis for both internal and external approximations. For the linear virtual element method, we obtain the optimal order error estimate. Finally, three numerical examples are reported, providing numerical evidence of the theoretically predicted optimal convergence orders.