Brazil beat Spain to win Confederations Cup