Attenuating Catastrophic Forgetting by Joint Contrastive and Incremental Learning