You can backup iOS devices to iCloud (iPhones, iPads, iPod Touchs), but. there is no support for backing up a Mac to iCloud. iCloud backup is only for the iOS devices available.
See: What does iCloud back up? - Apple Support
But you can use iCloud on your Mac to store documents iCloud - your complete Documents folder or the Desktop folder, plus additional files and folders on iCloud Drive. But this will not be a backup. Your documents will be moved to iCloud, but you still need Time Machine or another backup method to create a safety copy.
When you use iCloud with a Mac and with an iPhone, the devices will share your subscription for iCloud Storage. Only My Photo Stream or Shared Albums do not count against your paid iCloud storage subscription.