Enhancing Event Sequence Modeling with Contrastive Relational Inference