Noether symmetry in f(R) cosmology