How to control the display's backlight in the sketch?

do I really need a resistor if I limit the PWM output to 3.3v (as in my code)

You can't limit the output to 3V3 in software. PWM is always a 5V signal, it is just the on / off ratio that changes.
See this for how it works:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

You always need a current limiting device when using an LED and a resistor is the simplest one you can have. Anyone who tells you different is wrong.