The chemistry of star-forming regions