Atletico Madrid have reached an agreement to sign Rayo Vallecano striker Leo Baptistao for an undisclosed fee.