After months of heightened tensions, the United States and Venezuela have agreed to resume diplomatic and consular relations, the US State Department says.