Influence of baryonic physics in galaxy simulations: - A semi-analytic treatment of the molecular component