The VLT-FLAMES Tarantula Survey XVI. The optical+NIR extinction laws in 30 Doradus and the photometric determination of the effective temperatures of OB stars