UF is designed and approved for direct burial. For direct burial, the required depth is 24" or less depending on AHJ or if it's under pavement, you'll have to read the Table 300.5 in the NEC to get the exact details. Your deck is not considered a building in the NEC so it will need to be buried. It also must not be exposed to sunlight unless the wire you use is specifically rated for it.
I can't remember if UF is compliant for being run in conduit, I don't think it is, but even if it is, it would be miserable pulling that through. Instead, if you use conduit, you should use THWN since the interior of the conduit is considered a wet location, and you must also use waterproof compliant splices if any are inside the conduit.
If you don't want to dig a 24" deep trench, you need to use conduit, and it needs to be protected either by still being 18" or more below grade, or use other means of protection from physical damage.