Matthew 5:39 is NOT a contradiction with Gensis 9:5 and Romans 13:1-5 and other scriptures (e.g. Leviticus, Deuteronomy) that address the death penalty. In Matthew 5, Jesus teaches how Christians should behave in 1:1 relationships with others.
However, the sword of execution is ordained by God & given to the governing body. The 1:1 turn the other cheek does not apply. It is for swift justice for the murderer as well as protection for the citizens. Ultimately, it is an earthly example of divine wrath that will be executed on all men who dishonor/reject Jesus Christ and His commands. The Bible is the foundation of the American justice system.