It is a biblical commandment to remember the Exodus every day, as it says (Deuteronomy 16:3), “Therefore you will remember the day you left Egypt all the days of your life.” The Chachamim learn from the word “all” (kol) that the mitzvah to remember the Exodus is performed both during the day and at night (Berachot 12b). This mitzvah can be fulfilled by reciting any verse that discusses leaving Egypt, or by mentioning the Exodus in one’s own words.
The Chachamim instituted reciting the Vayomer paragraph in order to fulfill the mitzvah of remembering the Exodus from Egypt. Therefore, there are two reasons why Vayomer was incorporated into the recital of the Shema. First, it mentions the mitzvah of tzitzit that reminds us of all the mitzvot. Second, it talks about the Exodus from Egypt. It is therefore customary to say Vayomer even at night, for although there is no need to mention the mitzvah of tzitzit then, we say it to remember the Exodus (see Berachot 14b, and Kesef Mishneh, Hilchot Keriat Shema, chapter 1: 2-3).
There is a difference between the mitzvah of Keriat Shema and the mitzvah of remembering the Exodus from Egypt. The mitzvah of Keriat Shema can only be fulfilled within the first three hours of the day because that is the time we wake up, whereas the daytime mitzvah of remembering the Exodus can be performed throughout the entire day. However, following the enactment of the Chachamim, we fulfill the mitzvah of remembering the Exodus with the recital of Shema, and if the time to say Shema has passed, a person can remember the Exodus from Egypt by reciting the berachah of “Emet V’Yatziv.” If four hours have passed, one may fulfill the mitzvah by saying the Vayomer paragraph or by remembering the Exodus in another way (Mishnah Berurah 58:27, 67:3; see earlier in this book 11:11; and see the laws of Ma’ariv, further in this book chapter 25, end of note 3).