Cooperative R&D between vertically related firms with spillovers