For most people, the lower back will curve a little bit in a lying down position with straight legs. The reason is, that when the hip is extended, the pelvis will tilt a little bit forward from the weight of the legs. Also, the psoas major attaches to the spine, and does not let the it down when the hips are extended. Bending the knees slightly reduces the extension in the hips and the spine can be flat on the floor.
The "correct" posture will depend on what your goal is.
- If your goal is to relax fully in a passive way, the best is to put a pillow under the knees. This allows for the spine to relax on the floor, with the abdominals, back, hips, and legs relaxed.

- If your goal is to exercise, then activate the abdominals and force the spine flat on the floor. Start with the legs 90 degrees from the floor and lower them gradually. Most people will find it very difficult to let the legs below 30 degrees and keep the spine on the floor. This is because the abdominal muscles are not strong enough to keep the hips from tilting from the leverage of the legs.

An extreme version of this is known as the hollow body hold in gymnastics, with the legs only slightly lifted from the floor, while keeping the spine flat. For most people this is a really difficult position to hold.

In yoga, however, it is not necessary that you achieve this level of strength.
Edit - Expanding this point. In yoga asana, you should always try to remain comfortable and not overly exert yourself. In practice it means, that you should approach the pose gradually. Do not lower your leg so much that your breathing, or spinal alignment is compromised. Do not compare yourself with others, because how difficult it is depends on many factors (your weight, body proportions, level of training etc). The correct pose for you might not look exactly like someone elses, so if your leg is higher than shown on pictures/videos then accept that. Gradually increase the time you can hold the pose with ease, and slowly lower your legs. With time, your body will adapt and the pose will feel much easier.
- It is usually not a good idea to let the spine off the floor in this pose, because the forces compress the lower back and this can be painful for some people. However, there is a way to do Uttanapadasana with the spine off the floor, which is reasonably safe for the lower back, but it requires that the neck is strong and healty:

This works because the torso is elevated using the head, which reduces the arc in the lower back. Needless to say, this poses a certain risk for the neck, so only do this if your neck is strong enough to support and balance the weight while the neck is extended.