Variational-hemivariational inequalities refer to the inequality problems where both convex and nonconvex functions are involved. In this paper, we consider the numerical solution of a family of stationary variational-hemivariational inequalities by the finite element method. For a variational-hemivariational inequality of a general form, we prove convergence of numerical solutions. For some particular variational-hemivariational inequalities, we provide error estimates of numerical solutions, which are of optimal order for the linear finite element method under appropriate solution regularity assumptions. Numerical results are reported on solving a variational-hemivariational inequality modeling the contact between an elastic body and a foundation with the linear finite element, illustrating the theoretically predicted optimal first order convergence and providing their mechanical interpretations.