The role of the charge state of PAHs in ultraviolet extinction