US President Donald Trump has said the "prayers of millions have finally been answered" after a Gaza peace deal was signed at a global summit in Egypt.