First-principles study of lattice dynamics of LiFePO4