Can't sync or even access contacts of Moto G4 / E4 and fresh Android 7.1.1
As I was suggested (in some other source), factory-reseting the phone might do the trick. And it did, but source of problem was different and factory-reset only revealed it.

It turned out that for some reason the Calendar Storage application was disabled on both phones:



It is a system application, so you must tap on ⚙ > Apps > ⋮ > Show system in order to see this item.

After enabling back of this application everything started working with a snap of finger, without even a need of restarting the phone.

I figured this out after factory-reseting of the first phone mentioned in question, so I managed to fix the problem on the other one without need of factory-reseting it as well.