iPhone 6s not displaying names on text messages
I tried the answer above but that didn't work for me. After some trial and error turning off contacts in iCloud and then turning them back on worked for me. 


Go to settings > iCloud
Turn off "Contacts" option
It will ask you if you want to delete the contacts synced on the phone or keep them. I deleted them.
Verify that the contacts are gone. (Optional)
Go back to the iCloud settings and turn the contacts on. 


This worked for me. Took about a minute for all contacts to resolve in Messages app. I am on iOS 10.2 and this happened when my phone turned off unexpectedly due to battery issues.