There has been a growing interest to incorporate Unmanned Underwater Vehicles (UUVs) in various military applications. UUVs can be easily deployed in an area of interest such as offshore fleet operating regions and littoral penetration zones to collect critical data. In many military scenarios, collected sensor data have to be transmitted to a host station which could be a land base station, a host surface ship, a communication relay aircraft or a satellite. Since these types of missions require considerable on-station time, it is very important to perform them in an energy-optimal manner. This paper proposes a novel approach that minimizes energy consumption in collecting and communicating sensor data using a group of UUVs. Specifically, our approach determines the optimal mix of communication and vehicle repositioning for a given spatial configuration of UUVs and the location of the base station they must relay their information to. Our goal is to minimize total energy consumption which includes energies spent in underwater communications among the UUVs, the propulsions of the UUVs required to achieve communications and the RF communications conducted by surfacing UUVs to send the sensor data. Integer Linear Programming (ILP) is used to formulate the problem and solve it optimally under performance constraints. Our experiments show that the proposed approach is very effective in reducing energy consumption required for communication activities and the solution times experienced are not excessive.