How can I prevent an outside lock from freezing?
The problem here of course is that snow/freezing rain gets into the lock and freezes.  With a house, this isn't normally a problem for a few reasons.  First, you use it often enough that it doesn't get that bad, and second the inside of the house is warm, which prevents water from freezing inside the lock (unless it gets really, really cold I suppose).

You might want to look for a lock that has a metal shield over the area where you insert the key to prevent water from getting inside.  Similar to what you have on a car door lock (and for the same reason).  Personally, I've never seen any home locks like that, but that's not to say they don't exist.

A simpler option, and the one I would suggest, would be to put a plastic baggie over the doorknob and secure it with a rubberband.  Then just take the baggie off when you need to unlock it and put it back on after you are done.  It's a bit inconvenient, but if you hardly ever use the shed in the winter anyways, it should keep the water out and is probably the most practical option.