Number of divisors of a number - in NP?
A number with k binary digits has at most k prime factors. That's because the smallest number with k prime factors is 2^k. 

So given a number m with k binary digits you can easily be given a list of the prime factors of m. You can check that the product of these prime factors is indeed m in polynomial time easily. You can easily calculate the number of factors from the prime factors in polynomial time. 

But what you also need to do is that the purported list of prime factors is actually a list of primes. Here comes another theorem that shows for every prime p, there is an easily verifiable proof that p is indeed a prime. 

The oracle should contain a list of the prime factors, and for every item in the list an oracle for proving that it is prime. 

For being in NP, there is absolutely no need that you are able to provide the oracle in polynomial time. You only need to be able to check it in polynomial time.