Change of variables for $A_\infty$ weights by means of quasiconformal mappings: sharp results