Contracting elements and random walks