I had this same problem, and I just figured it out. You need to add the country code to your contact phone numbers. Here's why. In this example, I'm going to use my scenario; I'm a USA resident (USA has telephone country code of "+1") and I'm traveling in Mexico (country code of "+52").
Suppose I'm in the USA, and my buddy texts me from (123) 456-7890. The iPhone probably sees this message as being from the number with the full country code: "+1 123 456 7890". It looks for this number in my contacts, but can't find it (because I've got the number as just "(123) 456 7890"... without the country code). So, it looks at the country I'm currently in. The country code I'm in is "+1", which matches the one in the message. It figures that I'm not a world traveler and I never use country codes, so it tries stripping the country code off of the number on the incoming message. In this case, it takes the "+1" off of "+1 123 456 7890" to get "123 456 7890", which does match the number I have in my contacts. So, in the USA, things work fine on my non-country-coded contact numbers.
Now, suppose I go to Mexico. I'm now in country code 52. Now, when I go to the Messages app, the iPhone sees a thread of messages from "+1 123 456 7890". Again, the iPhone checks my contacts, but doesn't find this number. So, again, it checks to see if maybe I'm in the same country code as the number the messages came from, but I'm not. So, it doesn't find a match.
So, the solution is to go to all of your contacts and add the "+ country-code" to the beginning of their phone numbers. The Message app will actually be of some help, here, as it shows you the full number on the message threads. So, you don't need to look up the country codes of anybody. You just need to go to, say, the thread labeled "+1 123 456 7890" and read some of the thread to figure out who it's from. Then, go edit that contact and, in this case, add "+1" to the beginning of their phone number(s). Their contact names will show up in the Messages app immediately.
Now, here's why you might *not* want to do this. If you leave the country code off, then, like you are currently experiencing, your Messages app will show phone numbers instead of contact names. However, your iMessage conversations will still have the contact names. This way, you can easily distinguish between your iMessage threads and your SMS threads. The reason you may want to do this is that your iMessage messages will be completely free (provided that you have a data plan for your foreign SIM card), while your SMS messages will probably incur a per-message fee. Granted, you can always just check for blue or green bubbles when viewing the thread, but... I'm just saying that there are conceivable scenarios wherein you would want your phone-number-based threads to stay as numbers.
Hope this helps!