Learning to Generate Answers with Citations via Factual Consistency Models