Where is the compiled template? Putting a breakpoint in there will tell you more. I suspect you are not passing a hash to the template when you invoke it with a key contacts. Basically the template you declared should get a data set which looks something like this:
{contacts: [....]}
this obviously assumes you are not compiling in advanced mode.