Somehow when I upgraded my iPhone a year or so ago my Outlook account got set to the Contacts default account and all contacts created on my phone were stored there, not in iCloud. I panicked when they were missing when I restored to my new iPhone 7, then they reappeared after I connected to Outlook again.
I wanted all of them in iCloud, so on my iPhone I went to Settings, Contacts, Accounts, and turned off Contacts for my Outlook account. It asked if I wanted to delete the contacts from my phone and I said "yes" so that I wouldn't have duplicates on my phone after I moved them from Outlook to iCloud. (It didn't delete them from my Outlook account, so I could have restored them from there later if I needed to. In Outlook, I selected a set of contacts and right-clicked on them and selected "Forward" and e-mailed them to my Gmail account. I had to do them in batches because they were too big to send in one message. They got sent as individual vCard (.vcf) attachments, about 50 per batch. From my Mac, I opened Gmail, found each message and saved "all attachments" to my downloads folder. It conveniently saved them as a single .zip file for each message. From the Finder, I double-clicked each .zip file and it created an un-zipped folder of contact .vcf files. I selected all the .vcf files in the folder and then double-clicked on them. The "Contacts" app asked me if I wanted to add the contacts to my contacts and I consented. Then they all showed up in my iCloud contacts on my Mac and my iPhone.
I wish I could "copy contacts from all sources to iCloud" from my phone. Would have been a lot easier. Are you listening Apple?