Praise be to Allah.
There is no contradiction between this aayah and the fact that the fast is broken after the sun sets, because night begins when the sun sets. The beginning of the night is sunset, and the end of the night is when dawn comes. Hence the Prophet (peace and blessings of Allaah be upon him) said: “When night comes, and day ends, and the sun has set, then let the fasting person break his fast.” What the hadeeth means is that when the sun has set, night has begun and day has ended, and at that time it becomes permissible for the fasting person to break his fast. See Sharh Muslim by al-Nawawi (7/209).
And Allaah knows best. May Allaah bless our Prophet Muhammad.