Voltaire said, "If God did not exist, it would be necessary to invent him." And really, he did actually say it:
http://www.whitman.edu/VSA/trois...
Voltaire's reasoning is that God is necessary for humans to behave, especially humans in power:
Kings, if you oppress me, if your eminencies disdain
The tears of the innocent that you cause to flow,
My avenger is in the heavens
But Voltaire is not quite as cynical as he sounds. He thinks it need not be true forever:
I see from afar that era coming, those happy days,
When philosophy, enlightening humanity,
Must lead them in peace to the feet of the common master;
Frightful fanaticism will tremble to appear there:
There will be less dogma with more virtue.