Instead of combining desk and bed space, another way to go is to look for ways to combine your bookshelves into your desk. Especially try to find a corner, possibly somewhat round desk with large shelf space.
If you have a dresser, it can be easily replaced by beds with large drawers as the base.
Put shelves up directly on the walls at a decent height to save floor space. You could mount them above and around the desk. I've seen tables built into walls and even some drawers / cabinets. If you can reduce all your current furniture's actual floorspace while keeping the storage space, there should be plenty of room for a bed =)