Yes, a UPS can help your situation especially if you experience power outages from time to time.
There are 3 types of UPS devices; online, line-interactive and standby. UPS devices are not my expertise so off the top of my head I do not know the difference between line-interactive and standby UPS; both do not activate until the UPS detects there is a loss of power. These are the least expensive types of UPS.
The online UPS is the most expensive version and it is the one you want to buy. Basically the battery charges from the A/C outlet, then sends power to whatever is connected to the online UPS. As mention above by jsmithepa, the battery will need to be replaced every 2 - 4 years because the battery is always active.
While an online UPS is not exactly like a line conditioner which is generally used to convert "dirty" power from the A/C outlet to "clean" power for whatever electronic device is connected to it. However, for all intents and purposes it basically will act like one.
During power outages, the UPS will act as an external power supply, thus allowing you to continue using your laptop for a longer period of time compared to simply relying on the laptop's battery.
Since surge protectors are generally not expensive you should connect the surge protector to the A/C outlet, then connect the UPS to the surge protector, and finally connect the laptop to the UPS.