Hydraulic problem. Crew could not fully retract the landing gear after departure from Caracas. The airplane entered a holding to troubleshoot the problem, after about 25 minutes the crew declared emergency however the aircraft burned off fuel before landing safely at Caracas almost 3 hours after departure.