Google account contacts are backed up to
Google Contacts. For others, export them, then import them
as Google account contacts. Then go to Google Contacts and eliminate duplicates. (Or export all your contacts, go to Google Contacts, delete all your contacts, delete all your contacts on the phone, then import the file as Google account contacts.)