An accelerated Monte Carlo method to solve two-dimensional radiative transfer and molecular excitation