Is there a way to have time machine work well with iCloud (keeping the backup there)?
iCloud is not a backup solution, it is a sync solution.
It will hold phone/pad backups, but not computer.
You cannot use it to store data that is not also present on your devices, other than such as offloading full-resolution photos or documents in low-space situations locally.
For true off-site backup you need to be looking at such as Backblaze.