I recently updated to iOS 5 (I know it took me forever), and after I did, all my contacts disappeared. However, when I would dial a number, it recognized it and would show the person's name. It stayed like that for a few hours, and then miraculously my contacts reappeared after I turned the phone off and on a few times. How did that happen?
I had the same problem. Contacts were showing up, for example, if someone called me or sent me a text and were therefore in my 'Recents', but did not show up in my contacts list either through the contacts app or through the phone contacts list itself (probably the same thing anyway!).
The solution that worked for me was to go into iCloud on my iPhone and set Contacts to 'off'. This gave me the option to 'Keep on my iPhone' or 'Delete from My iPhone'. I chose to delete them. Once this had happened, I re-enabled Contacts and my contacts list was all synchronised back from iCloud correctly within a couple of minutes.
Since you don't have the problem anymore, it will be pretty hard to diagnose if we can't reproduce the issue.
My guess would be that you had your contacts sync with Google over Exchange and when you upgraded to iOS and iCloud, the contacts where moved from Google to iCloud.
But it wasn't instantaneous (iCloud was sometimes slow after launch), so your contacts were no longer on Google and still not on iCloud (they probably wait until the upload process is finished to show them on the Contacts app).
That could be why your contacts list was empty (still not uploaded), but when you typed the number, iOS knew the name (the contacts where still on the iPhone, waiting for the upload to complete) and printed it.
Another theory could be that Exchange has 2 contacts "states". The contacts on your address book (that are always on your phone) and the one you can find by searching on the server (from the Contacts app).
And when you typed the number, iOS searched on the server to see if it got a match and printed it, since the contact exists on the server.
I'm a bit less convinced about the second theory, but like I said, it'll be hard to find the real reason for this temporary upgrade glitch, now.
Occasionally I see a similar behaviour. I believe it is a bug in iOS.
I sync contacts with outlook tethered via iTunes. Sometimes, after adding new contacts, these do not show up in the contacts app as well as in the phonebook.
They however can be found in spotlight search (left from the home screen) and after some time they appear in the phone book.
When I upgraded my iOS I had the same behavior - contacts not showing up to use but if you key in the number or have an incoming call they names are there.
These contacts I think were all exclusively on the phone and had mostly been carried over from a dumb phone - and I had never synched to a contact manager. To restore usage of the contacts I had to enable the iCloud syncing of contacts from a MacBook Air that had a backup of the phone up to before iOS upgrade. Before upgrading iOS, the contacts would show correctly - almost immediately.
To me, this is really weird behavior - but I guess it kinda makes sense - if someone had say stolen the phone and installed a new iOS to key around my password protection the contacts would not be visible. It was very frustrating to think all your contacts disappeared as part of the iOS upgrade. Glad to have found this thread, not sure I would have figure this out without everyone's help.
Make sure you're viewing "All Contacts" in the Contacts app. Sometimes it's easy to select an empty group as your default view. Check the left arrow in the upper left hand corner of the app.
Also, if you go to groups, THERE IS AN OPTION TO HIDE ALL CONTACTS at the very top of the page. If you accidentally hit that option, your contacts will be hidden.