I'm not aware of any country that carries out a census on a voluntary basis. There are countries that do not carry out a census and collect that information through other means, generally through some kind of registration system, but that system is mandatory in itself, and people have to report that information. I can't say I've canvassed the world, but I'm not aware of countries that do not carry out a mandatory census.
The U.S. actually moved to a new method of data collection. They do a survey, but that survey, since it replaced the census, is actually mandatory as well.