Multiphase transport model for relativistic heavy ion collisions