Enhancing the Unified Streaming and Non-streaming Model with Contrastive Learning