During squats and deadlifts the ideal is to maintain a neutral spine throughout the whole movement. Neutral spine includes a natural lumbar curve (so it's not perfectly straight), but you do not want an exaggerated lumbar curve.
That does not mean, however, that your torso will stay perpendicular to the floor. There will be hip bend (just not low back bending, either forward into anterior pelvic tilt or backward into posterior pelvic tilt). So it's correct to push your hips back during the squat. Bend the hips, but not the back.
The line from the crown of the head to the tailbone remains consistent even as the torso angles forward from hip bending. In a squat the line of the torso might be about a 45 degree angle relative to the floor. In a dead the hips are higher, there's more hip bend, so that angle (relative to the floor) will be even smaller. But in both lifts there should be no pelvic tilt at all, just natural lumbar curve at all times.
I hope that was clear and not confusing!
Hips Don't Lie: Fixing Your Force Couples by Mike Robertson might help your understanding of this topic.