A bound for norms of functions of matrices