Understanding the Role of Nonlinearity in Training Dynamics of Contrastive Learning