Did you follow the steps in this article? Are the contacts not syncing with iCloud? Is other data syncing with iCloud?
What to do after you change your Apple ID or password - Apple Support
Try Settings/Your Name/iCloud and slide off syncing. Wait a few minutes and then slide syncing on.
Last resort - have you tried signing out of iCloud and then sign back in?