Try this if your contacts are in iCloud or in your chosen email account
(You might want to back up the phone first, and if your contacts are phone only you have no remedy)
Close Messages app. then for
Contacts in iCloud:
Settings, Your name, iCloud, Turn off contacts
Contacts in another email account
Settings, Contacts, Accounts
Find the account with Contacts turned on. Turn contacts off Â
Â
When asked if you want to keep them, choose “delete from my iphone ”
Â
Open Contacts app and it should be empty.
Â
Power the phone off and back on.
Â
Then
Contacts in iCloud:
Settings, Your name, iCloud, Contacts. Turn it On
Contacts in another email account
Settings, Contacts, Accounts
Find the account with the Contacts again. Turn contacts On
Â
Open Contacts app and it should be re-populated.
Â
Then try messages again.Â
Â
You might find these interesting
About Apple IDs
Sync your contacts
If your contacts do not sync
Â