Contractor is a temporary resource brought in from outside of organisation. Contractors' job is done when they finish delivering products or services specified in their contract.
Consultant is a specific kind of contractor. Their primary job is not just scaling up the existing team, but delivery of knowledge transfer. Consultants invest time into learning a specific topic or coming up with a new way of doing things, then they come to an organisation and transfer that knowledge to the locals, so that the team can carry on doing the job without need for the consultant to stay with the organisation.