The temperature is not only related to "how close we are to the sun". (It's actually more to do with angles than distances, but that's a whole other subject.) It's also affected by the current ambient temperature.
In December, all other things being equal, the earth will receive the minimum amount of heat from the sun, and it will also have been cooling steadilly for the last 3 months or so. By January, the earth will be receiving very slightly more heat from the sun, but will have had 4 months or so of overall cooling.
The same effect can be seen on a daily basis - it's exactly the same as the reason why the hottest part of the day is mid-afternoon, and not noon.
FFF
-----------------