Beltran reaches deal with Astros