Virtual pullbacks in $K$-theory