“By contrast” is usually used to introduce information that contrasts information presented in the immediately preceding sentence. “In contrast to” is used to introduce a sentence where both pieces of contrasting information are provided. Please see the sentences below for examples on how to use each.
In contrast to sunny days, it is not necessary to wear a hat on cloudy days.
It is not necessary to wear a hat on cloudy days. By contrast, a hat is a must on sunny days.
?会話例1?
A: Hey Lisa!(ただいま?!)
b: Hey, how was your day?(おかえり!今日は1日どうだった?)
?会話例2?
A: Hi dad.(お父さん、ただいま!)
b: Hey Andrew. How was school today?(おかえり。今日は学校どうだった?)