If I do as you say, do I lose the latest photos that I have uploaded, after my latest Time Machine backup?
You would have to export all newer photos from your Photos Library to a folder (the photos you made after the last Time Machine backup), so you can add them back, if they should be missing after. you restore the library from Time Machine. The newer photos should download again from iCloud, since they are already in iCloud, but better be safe than sorry.
Regardless of this, what procedure do you suggest to follow: first turn on iCloud photo library on all devices and only then restore the backed-up photo library, or the other way round?
First enable iCloud Photo Library on all iOS devices you want to use with iCloud (iPhones, iPads, iPods), and only then restore the library on your Mac and enable iCloud Photo Library on the Mac.
This way the restored albums survived syncing when I tried this.