For a conference, when do the chairs distribute the papers to referees for review?
I have submitted a paper and discovered an error in the paper. Now, I want to withdraw before the submission deadline. Is this something advised against?
I doubt that the distribution time is important for your actual concern. It probably wouldn't be prior to the deadline, but might be. There are too many conferences with too many policies to be definite.
But you can withdraw your paper and it is unlikely that it would be a problem even after the deadline. But if you want to replace it with a newer version, rather than just withdraw it, you should probably contact the program (or conference) chair and ask for advice.
Many conferences give you a chance to provide a new version after review in any case. If the error isn't such that it would result in rejection, you might be able to just provide the corrections as part of the regular process. But for a serious flaw, contact the chair.