I am using Contacts OSX and iOS app's and they both synced into iCloud and I have opened them to check if the contacts are the same on my phone and Mac and they are.
However when I receive an iMessage or Text message in Messages OSX it doesn't recognise the number even though that number is saved in Contacts.