We can work in an orthonormal basis in which $A$ is diagonal. In that case the diagonal entries of $AB$ are $a_{ii}b_{ii}$, so $$ tr(AB) =\sum a_{ii}b_{ii} \leq \sum a_{ii}|b_{ii}| \leq \sum a_{ii} \|B\|=tr(A)\|B\|. $$