Zero knowledge proof of equality
In typical mathematician fashion, let me explain how to reduce your problem to a harder one ☺, namely homomorphic encryption. (Edit: I should have made it clear that the problem of constructing homomorphic encryption schemes, at least to the extent required here, is indeed solved.)
Assume Charlie is an "honest but curious" third party (i.e., Charlie can be trusted to perform computations honestly but should not be allowed to know $a$ or $b$): I hope it is not unreasonable to assume the existence of Charlie. Alice and Bob ask Charlie to set up a homomorphic encryption scheme and give them the public key. Alice and Bob each encrypt their integer using this public key, and share the (encrypted) result, but don't give it to Charlie. They then use the homomorphic properties of the scheme to compute the (encrypted) value of the "if $a=b$ then $1$ else $0$" function (as a boolean function, this does not require a large number of bit multiplications, so the homomorphic properties required are not too difficult to obtain). Both can perform the computation. They send the result to Charlie for decryption, and Charlie can return the result. Thus, at the end, Alice, Bob and Charlie each know whether $a=b$ but not what the numbers are except those they themselves chose.
Edit 2: as per Pace Nielsen's comment, I should have clarified that this kind of encryption is non-determinististic: there isn't just one cyphertext for each of the values from 1 to 10, there are a huge number, and neither Alice nor Bob can decrypt the other's value by simply trying out all possibilities.
Of course, this leaves a lot of questions unanswered, like whether we can arrange for Charlie not to know whether $a=b$, or do without Charlie altogether (probably something can be done with functional encryption or homomorphic encryption with a secret key that is split between Alice and Bob, but there are usually lots of honesty assumptions that might not be obvious). Perhaps more insidiously, I don't know how to make sure that Alice does not select a number outside the allowed range (a number that would essentially return "no" to any comparison with a number honestly chosen by Bob).
This partial answer is from an information theoretic perspective: This cannot be done with small number of rounds of talking. Suppose the players receive a number between 1 and $n$ and they want to know the answer with probability $1-\epsilon$. If the number of rounds in their conversation is smaller than $\log^*\min\{n, 1/\epsilon\}$, some extra information reveal must happen. This follows from [arXiv:1304.1217], though the reduction needs some explaining. Here $\log^*$ is the iterated logarithm function.
When an unbounded number of rounds is allowed, equality can be determined with probability 1 by revealing a very small amount of information (independent on $n$). Good thing about 0 information is it is 0 no matter how we measure it, but for non-zero information we need to specify how we measure it.
There is a fixed protocol P such that for any $(a,b)\in [n]\times[n]$ the parties learn whether $a=b$ with probability 1 and for any distribution $\mu$ on $[n]\times[n]$, if $(A,B)\sim \mu$,
$$ I(A;\Pi\,|\, B) + I(B;\Pi\,|\,A) < 4.5, $$
where $\Pi$ is a random variable denoting their conversation. This protocol is from ECCC:TR11-123, Proposition 3.21.
You are asking the socialist millionaire problem. There are several solutions to the problem, amongst them the one showed on the Wikipedia page, using the Diffie–Hellman-Merkle key exchange for secure multiparty computation.
The table describing it is a bit hard to copy into mathoverflow, but you can have a look at the protocol diagram: