The development of the Space-Air-Ground Integrated Network (SAGIN) represents a significant advancement in satellite Internet technology, primarily because it facilitates the provision of pervasive networking solutions for the Internet of Things (IoT). Central to minimizing energy consumption in this context is the strategic deployment of Unmanned Aerial Vehicles (UAVs) and the efficient offloading of computational tasks. This is due to the fact that the quality of communication between UAVs and ground-based mobile devices is a crucial determinant of both communication latency and energy usage. This study presents an in-depth exploration of a Mobile Edge Computing (MEC) framework within a SAGIN context, in which multiple UAVs serve as edge computing servers, thereby accelerating computational services to terrestrial devices. In parallel, Low Earth Orbit (LEO) satellites are leveraged to provide cloud computing services. We introduce a Dual-layer nested joint optimization technique fortified by an improved differential evolution. The outer layer of the algorithm employs a phased differential evolution technique to optimize the positioning of UAVs. Simultaneously, the inner layer adopts a greedy approach to optimize the offloading ratio for computational tasks. The effectiveness and superior performance of the proposed method are substantiated through extensive numerical simulations. Comparative analysis with existing benchmark techniques demonstrates a significant reduction in the energy consumption of the system, underscoring the potential of the proposed framework.