While there is a great deal of difference between 'compared with' and 'compared to' I am at a loss to explain a difference between "contrast with" and "contrast to". I suspect there is one.
It would be nice to have more context so we could provide a detailed response. Perhaps you could provide an example of the text where you saw the two used?
Student or Learner