You are trying to combine two different measures into a single rating: correct answer rate, and total number of answers, with the reasoning being that if two people have the same percentage correct, then it is less likely that the person with more overall questions attempted would have received that percentage by chance, hence you are ranking by both the raw percentage and the uncertainty in using that percentage to rank people accoring to the true, yet unknown, answer rate (assuming they answered an infinite number of questions).
A convenient way to come up with an "uncertainty"-weighted score is to use the Laplace estimator of the "correct guessing rate" for each person by teating their guesses as tosses of a fair coin with a 50% chance of getting "heads". This boils down to the following for a particular person, i:
$\hat p_{correct,i} =\frac{\#_{correct,i}+1}{n+2}$
What this estimator does is initially assume everyone is just guessing (when n=0) and hence all players have p=1/2. However, as data accumulates, the estimate approaches the observed fraction of correct answers. If two players, A and B, have the same observed percentage correct (i.e., $\%_A=\%_B$) but $n_A>n_B$, then $\hat p_A>\hat p_B$, satisfying your requirement that total guesses be taken into account.
EDIT 1: Expanding to other priors
The Laplace estimator is a special case of Bayesian estimation using a Beta-Binomial model. In the Laplace case, the prior is assumed to be a uniform density on [0,1]. This is a very diffuse prior, in that is says that 10% of the population would answer at least 90% of the answers correct, and 10% would get no more than 10% correct.
This is probably an unrealistic assumption about the knowledge of the general population. Most likley, people will end up guessing on a lot of questions, so we'd expect the prior to be more concentrated aroun 50%. To accomodate different assumptions about the general population's knowledge, you can use the Beta-Binomial model I linked to, with different parameters for the beta prior on [0,1] to represent your guess/estimate/assumptions about the population's general knowldge about your questions. The more concentrated you make your beta around 50%, the more correct/incorrect answers are required to shift the estimate for person i's "long run correct answer rate" away from 50%. Right now, its pretty easy to do so.
This type of estimate is called a "shrinkge estimate", the version for the beta-binomial is also in the link is sent you, here, where $\theta_i$ is the estimated long run fraction correct for person i.
Try out different beta priors to see what makes sense. Also consider how knowledgeable your population will be about the subject matter of your questions. The more knowlegeable, the more you should bias the beta towards 1. The less knowledgeable, the more it should concentrate around 50%. There really is no situation where you would bias downwards unless you purposefully put in tricky questions.