Keane Group Inc. and C&J Energy Services, two Houston-based oil and gas services companies, have agreed to combine their completions and production services operations such as hydraulic fracturing in shale basins and workover rigs in an all-stock merger valued at about $1.8 billion.