On some nonconvex variational problems related to hemivariational inequalities