"by contrast" and "in contrast" both describe the way something is sharply different from another thing.
The meaning is the same, but the usage is slightly different sometimes.
e.g.
1. Tom gave a rather low-key speech. By contrast, Steve was flamboyant from the very start.
2. The color of the butterfly's wings was in (stark) contrast with the surroundings.
As in (1), "by contrast" works well as an adverb in describing actions and events "in contrast" can sometimes work too.
In (2), only "in contrast" can work because it's in the predicative form of "BE in contrast (with/to)".
"on the contrary" means how something is in opposition to what was just said.
It is sometimes said to mean a strong "no" or "quite the reverse".
e.g.
- It is not an idea around which the Community can unite. On the contrary, I see it as one that will divide us.
- A: People just don't do things like that. B: On the contrary, they do them all the time. (from the Collins Dictionary)