Ge:1:1: In the beginning God created the heaven and the earth.
Ge:1:2: And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
Ge:1:3: And God said, Let there be light: and there was light.
Ge:1:4: And God saw the light, that it was good: and God divided the light from the darkness.
Ge:1:5: And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
Ge:1:13: And the evening and the morning were the third day.
Ge:1:14: And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years:
Ge:1:15: And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so.
Ge:1:16: And God made two great lights; the greater light to rule the day, and the lesser light to rule the night: he made the stars also.
Ge:1:17: And God set them in the firmament of the heaven to give light upon the earth,
Ge:1:18: And to rule over the day and over the night, and to divide the light from the darkness: and God saw that it was good.
Ge:1:19: And the evening and the morning were the fourth day.
The problem is that the Creation Myth is an amalgamation of two competing stories. Those who wrote it out considered that only one story would be the better idea. However, the proofreader then simply combined the stories as best he could.
Hence the contradiction.