Nonlinear propagation of fast and slow magnetosonic waves in collisional plasmas