Within-host dynamics of antigenic variation