Optimal Control of Differential Infectivity Models