On a class of variational inequalities with memory terms