A Herglotz-based integrator for nonholonomic mechanical systems