Oil edges higher on weaker dollar, demand optimism