Solving variational inequalities and cone complementarity problems in nonsmooth dynamics using the alternating direction method of multipliers