Shape optimization problems with Robin conditions on the free boundary