A Bismut-Elworthy formula for quadratic BSDEs