According to google ngrams the second variant is more widely used:
[It was cold there], what took us by surprise.
[It was cold there], which took us by surprise.
Can anybody, please, explain me why? Which variant is better? Will it be a mistake to use the first one?