The role of condensation and heat conduction in the formation of prominences: An MHD simulation