Is there any software which can convert a photograph to a black-and-white outline containing tiny numbers stating which color to give each area?
You could try plainclothes' suggestion, but personally I wouldn't count on Illustrator's live trace producing very usable results. Live trace has its limitations. Even the best live trace algorithms can't make a normal photo into a genuine illustration. When you compare the results from live trace to a hand-drawn illustration, it's quite obvious that today's software just isn't able to create sufficiently subject-aware outlines and color boundaries to produce passable results.
Unless you feed the live trace algorithm an illustration to start with, it's just going to look like a photo that's been put through a live trace filter. And that's not going to make a good paint-by-number outline.
At the end of the day, artists and illustrators still serve a purpose. And to get the desired end product, you'll need to hire a professional illustrator to create a suitable painting/illustration that can be reproduced in paint-by-number style.
If you don't want to spend the money to do that, then your best bet is probably to live trace some stained glass artwork. This is really more color-by-number, but it doesn't require an actual artist to manually create the outlines.
I believe one of these would be the answer to such a question.
Stoik's Color By Number is a $20 program (or a 15 day free trial) you can find at stoik.com that uses very easy steps:
The Browse Tab - Pick the image you want to convert.
The Image Tab - Contrast, Brightness, Size, Posterize, ect.
The Pattern Tab - Palette choice; Whatever color scheme you would like and how many colors you want to use.
The Export Tab - Export; print, save, ect.
The end result is a paint by numbers version of the image (just lines and numbers corresponding to colors) and a color map of what it should look like after you've finished painting.
I don't know too much about Paint a Pic. It seems like it is relatively new.
Paint a Pic is a web-based application/service that'll cost you $50 an image that, after being processed, is sent directly to you in physical form.
The end result is very similar to Color By Number, except lines are more defined, where as in Color By Number the lines are faint and blue so as to fade away easily as paint is applied.