The problem here is it's passive aggressive and doesn't actually communicate the issue to your colleague. The fact he's producing bad code probably isn't something he gets up to do every day.
The first part of any situation like this is clear communication. Talk to the person and you may have to do it dozens of times before it gets through. That doesn't mean the equivalent of throwing a bug report at him "Hey buddy, your code is shit. Fix it!"
He's a colleague. Sit down and talk through some of the code. Note your concerns and offer to help. Have clear and precise examples of your concerns, maybe presenting him with evidence. The first reaction any sane person is going to have if someone approached them like this is embarrassment and they're probably going to get a little defensive. Know that going in and tailor your conversation appropriately.
Enter in to the situation with some level of respect maybe even if that person hasn't really shown that he's deserved it.
Possibly, he'll never change, but I've seen enough people get better through coaching, mentoring and encouragement to know it's just as likely he'll make an effort if approached in the right way.
Op is a contractor, not a life coach. I doubt his contract includes a large number of hours for mentoring. Maybe he could request them?