The ideal would be to hook it up to the UPS, and hard drives use very little power (about 10 watts), so it shouldn't make a significant difference to your runtime.
If the power is disconnected to the drive but not the computer it could lead to a backup failing, which could be a nuisance. If it happens at just the wrong moment and the Filesystem doesn't support journaling it can corrupt the backup, but even if this wasn't the case, depending on the UPS, you may find the power delivered to the drive is smoother, which is generally a good thing for the life of electronics.