On the formation and physical properties of the intracluster light in hierarchical galaxy formation models