Ban Ki-Moon is the secretary general of the United Nations but he does not represent all the countries in the world.
You are right. He represents the peoples of the world, not the countries.
To clarify the secretary general's role, from
http://www.un.org/sg/sg_role.shtml:
a spokesman for the interests of the world's peoples, in particular the poor and vulnerable among them.
[...]
The Secretary-General would fail if he did not take careful account of the concerns of Member States, but he must also uphold the values and moral authority of the United Nations, and speak and act for peace, even at the risk, from time to time, of challenging or disagreeing with those same Member States.