Oscar Piastri took a crucial pole position for the Qatar Grand Prix, beating Lando Norris in second and Max Verstappen in third.