Well you haven't mentioned what kind of unit it is, what your setup is (sump? Canister?)
But this advice should apply if you have a sump (which you should...)
In short, you don't want to do it exactly the way you suggested.
A UV unit varies in effectiveness from "would kill an elephant passing through" to "won't kill squat" depending on how fast water passes through the unit.
The odds are, your return pump is moving water way too fast. You generally only want about 100-300gph of flow through the unit, to make sure that larger stuff like parasites can be sufficiently exposed to ensure death.
There is a way.
I posted two professional-looking graphics.
The first one shows one way of doing it. This method has a big advantage... all of the flow from the return pump ends up going into the tank. This is the method to use if you need every bit of flow you can from your return pump. By manipulating the two valves, you can vary the amount of water that passes through the unit. This method has two drawbacks. First, it puts water pressure on the UV unit, which it may or may not be able to take without leaking (depending on how much head pressure you have, whether you have valves in between the pictured rig and the tank, etc). Second, it's impossible to tell how much flow is going through the unit and how much is passing by without installing a flow meter.
The second option is what I do. As long as your return pump is rated for more flow than you need, you can divert off of the main return line to feed your UV unit and send the discharge water right back into the sump. This allows you to visually watch the discharge hose to guestimate how much water is flowing through it.
If neither of these options are acceptable, you may need to place a dedicated pump in your sump to handle it.
Edit: One other thing I thought of... if you want the best of both worlds (all the flow from the main pump going to the tank and being able to tell the flow), you could do the same thing as option 2, but instead of discharging into the sump, discharge into the main tank, with some sort of arrangement that you can life the inflow pipe out of the water to view how much water is passing through it.