Hybrid modelling and simulation of rigid bodies in contact