Numerical analysis of history-dependent variational-hemivariational inequalities