The afterglow and kilonova of the short GRB 160821B