The short answer is that you can't. Varnish only allows you to edit outbound Headers, not the content of the outbound response. It does allow you to add C code to the vcl file, so you might be able to hack something together, but it's not designed for it.
Otherwise, I would recommend Mircea's options; either using ESI, or modifying apache or whichever webserver you're using to inject the code.
Just in case, as your question didn't make it clear, you don't need to get Varnish to add the Analytics monitoring code in order for the sites to be monitored, only that that code is on the page. The analytics code all works client-side, making calls directly from the visitor's browser.
Make sure to configure varnish to disregard the analytics cookies - your backend webserver doesn't need them, and leaving them will kill your hit rate :)