Nonsmooth dynamic analysis of sticking impacts in rocking structures